<template>
	<view class="content">
		<text style="color: black;">子组件A</text>
		<view class="coma_box">
			<text>父组件传进来的值：</text>
			<text>{{intent}}</text>
		</view>
		<button @click="sendData()">传值给CompB组件</button>
	</view>
</template>

<script>
	export default {
		props: ['intent'],
		data() {
			return {

			};
		},
		methods: {
			sendData() {
				console.warn("----CompA----sendData----->" + this.intent);
				uni.$emit('getIntent', this.intent);
			}
		}
	}
</script>

<style>
	.content {
		height: 120px;
		margin: 10px 0;
		padding: 15px;
		background-color: #ff8111;
		border-radius: 8px;
		display: flex;
		flex-direction: column;
		align-items: center;
		justify-content: space-around;
	}
	.content text:first-child{
		font-size: 18px;
		font-weight: bold;
		color: #fff;
	}
	.coma_box{
		color: #fff;
		font-size: 14px;
	}
	.coma_box text :last-child{
		color: red;
		font-weight: bold;
	}
	.content button{
		width: 80%;
		background-color: #007aff;
		color: #fff;
		border: none;
		border-radius: 4px;
		padding: 8px 0;
		font-size: 14px;
	}
</style>